package com.jjsc.product.api;

import com.jjsc.common.core.constant.SecurityConstants;
import com.jjsc.common.core.constant.ServiceNameConstants;
import com.jjsc.common.core.domain.R;
import com.jjsc.common.core.web.domain.AjaxResult;
import com.jjsc.product.api.domain.Product;
import com.jjsc.product.api.domain.ProductSku;
import com.jjsc.product.api.domain.skuPriceVo;
import com.jjsc.product.api.factory.ProductFeignFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @Author: 钟城明
 * @CreateTime: 2025-10-06
 * @Description:
 * @Version: 1.0
 */
@FeignClient(
        contextId = "RemoteProductService",
        path = "/productSku",
        value = ServiceNameConstants.PRODUCT_SERVICE,
        fallbackFactory = ProductFeignFallback.class
)
public interface RemoteProductService {
    @GetMapping("/getProductSku/{skuId}")
    public R<ProductSku> getProductSku(
            @PathVariable("skuId") Long skuId,
            @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
    @GetMapping("/getSkuPrice/{skuId}")
    public R<skuPriceVo> getSkuPrice(
            @PathVariable("skuId") Long skuId,
            @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
    @PostMapping(value = "/getSkuPriceList")
    public R<List<skuPriceVo>> getSkuPriceList(
            @RequestBody List<Long> skuIdList,
            @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

}
